{extend name="public/base" /}
{block name="body"}
<!--主题-->
<div class="page-header">
    <h1>
        您当前操作
        <small>
            <i class="ace-icon fa fa-angle-double-right"></i>
            配置权限
        </small>
    </h1>
</div>
<div class="row">
    <div class="col-xs-12">
        <form class="form-horizontal" name="admin_group_add" id="myform" method="post" action="{:url('Managegroup/groupaccess')}">
            <input name="id" id="id" type="hidden" value="{$id}"/>

            <div class="form-group">
                <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 用户组名： </label>

                <div class="col-sm-10">
                    <input type="text" name="title" id="title" value="{$row['title']}" class="col-xs-10 col-sm-4"/>
                </div>
            </div>
            <div class="space-4"></div>


            <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">

                <tr>
                    <td height="30" style="border-bottom:#CCCCCC solid 1px; line-height:25px;">配置规则:<br/>
                        1、由于页面原因，权限分配为三级，同时控制左侧导航以及用户权限<br/>
                        2、部分不需要分配的权限需要在AUTH的控制器里手动添加<br/>
                        3、如果有选择第三级权限，那么一级和二级权限也必须勾选
                    </td>
                </tr>
                {volist name="list" id="vo"}
                <tr>
                    <td height="50" style="border-bottom:#CCCCCC solid 1px;">
                        <label>
                            <input {if condition="in_array($vo['id'],$row['rules'])" }checked{/if}
                            name="new_rules[]" class="ace ace-checkbox-2" type="checkbox" value="{$vo.id}" />
                            <span class="lbl"> <strong>{$vo.title}</strong></span>
                        </label>
                    </td>
                </tr>
				{notempty name="vo['_child']"}
					{volist name="vo['_child']" id="sub"}
					<tr>
						<td height="40" style="padding-left:20px;border-bottom:#E7EBF8 dashed 1px; color:#333333">
							<label>
								<input {if condition="in_array($sub['id'],$row['rules'])" }checked{/if}
								name="new_rules[]" id="{$sub.id}" class="ace ace-checkbox-2" type="checkbox"
								value="{$sub.id}" />
								<span class="lbl"> {$sub.title}</span>
							</label>
						</td>
					</tr>
					{notempty name="sub['_child']"}
						{volist name="sub['_child']" id="subb"}
							<tr>
								<td height="30" style="padding-left:40px;border-bottom:#E7EBF8 dashed 1px; color:#666666">
									
									<label>
										<input {if condition="in_array($subb['id'],$row['rules'])" }checked{/if}
										name="new_rules[]" class="ace ace-checkbox-2" type="checkbox" id="{$subb.id}"
										value="{$subb.id}" />
										<span class="lbl" style="margin-right:20px;"> {$subb.title}</span>
									</label>
									
								</td>
							</tr>
							{notempty name="subb['_child']"}
							<tr>
								<td height="30" style="padding-left:60px;border-bottom:#E7EBF8 dashed 1px; color:#666666">
									{volist name="subb['_child']" id="vo"}
										<label class="">
											<input {if condition="in_array($vo['id'],$row['rules'])" }checked{/if}
											name="new_rules[]" class="ace ace-checkbox-2" type="checkbox" id="{$vo.id}"
											value="{$vo.id}" />
											<span class="lbl" style="margin-right:20px;"> {$vo.title}</span>
										</label>
									{/volist}
								</td>
							</tr>
							{/notempty}
						{/volist}
					{/notempty}
                {/volist}
				{/notempty}
                {/volist}
            </table>


            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>
                        保存
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="ace-icon fa fa-undo bigger-110"></i>
                        重置
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <a href="{:url('Managegroup/grouplist')}" class="btn btn-success" type="submit">
                        <i class="ace-icon fa fa-reply bigger-110"></i>
                        返回
                    </a>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}